{include file="common/_meta" /}
<title>用户管理</title>
<meta name="keywords" content="李志立，lizhilimaster@163.com">
<meta name="description" content="李志立，lizhilimaster@163.com">
</head>
<body>
	<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 用户中心 <span class="c-gray en">&gt;</span>
		用户管理 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);"
		 title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a></nav>
	<div class="page-container">
		<div class="text-c">
			<form action="" method="post">
				<input type="text" class="input-text" style="width:250px" placeholder="输入用户名称" id="" name="key">
				<button type="submit" class="btn btn-success radius" id="" name=""><i class="Hui-iconfont">&#xe665;</i> 搜用户</button>
			</form>
		</div>
		<div class="cl pd-5 bg-1 bk-gray mt-20">
			<span class="l">
			</span> <span class="r">共有数据：<strong>{$count1}</strong> 条</span> </div>
		<div class="mt-20">
			<table class="table table-border table-bordered table-hover table-bg table-sort">
				<thead>
					<tr class="text-c">
						<th width="80">ID</th>
						<th width="100">用户名</th>
						<th width="40">性别</th>
						<th width="90">手机</th>
						<th width="150">邮箱</th>
						<th width="300">地址</th>
						<th width="130">加入时间</th>
						<th width="70">状态</th>
						<th width="100">操作</th>
					</tr>
				</thead>
				<tbody>
					{volist name="member" id="vo"}
					<tr class="text-c">
						<td>{$vo.id}</td>
						<td><u style="cursor:pointer" class="text-primary" onclick="member_show('张三','member-show.html','10001','360','400')">{$vo.username}</u></td>
						<td>
							{switch name="vo.sex" }
							{case value="1"}男{/case}
							{case value="2"}女{/case}
							{default /}未知
							{/switch}
						</td>
						<td>{$vo.phone}</td>
						<td>{$vo.email}</td>
						<td class="text-l">{$vo.sheng} &nbsp; {$vo.shi} &nbsp; {$vo.xian}
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {$vo.address}</td>
						<td>{$vo.create_time|date='Y-m-d H:i:s'}</td>
						<td class="td-status">
							<span class="label label-danger radius">已删除</span>
						</td>
						<td class="td-manage">
							<a style="text-decoration:none" href="javascript:;" onClick="member_huanyuan(this,{$vo.id})" title="还原"><i class="Hui-iconfont">&#xe66b;</i></a>
							<a title="删除" href="javascript:;" onclick="member_zhongdel(this,{$vo.id})" class="ml-5" style="text-decoration:none"><i
								 class="Hui-iconfont">&#xe6e2;</i></a></td>
					</tr>
					{/volist}
				</tbody>
			</table>
			{$member|raw}
		</div>
	</div>
	{include file="common/_footer" /}
	<!--请在下方写此页面业务相关的脚本-->
	<script type="text/javascript" src="__MANAGE__lib/My97DatePicker/4.8/WdatePicker.js"></script>
	<script type="text/javascript">
		/*管理员-还原*/
		function member_huanyuan(obj, id) {
			layer.confirm('确认要还原吗？', function(index) {
				//此处请求后台程序，下方是成功后的前台处理……
				$.post(
					"{:url('member/ajax')}", {
						id: id,
						type: 'member_huanyuan',
					},
					function(result) {
						if (result === 1) {
							$(obj).parents("tr").remove();
							layer.msg('已还原!', {
								icon: 1,
								time: 1000
							});
							
						} else {
							layer.msg('还原失败!', {
								icon: 5,
								time: 1000
							});
						}
					});
			});
		}

		/*管理员-删除*/
		function member_zhongdel(obj, id) {
			layer.confirm('删除后将无法恢复，确认要删除吗？', function(index) {
				//此处请求后台程序，下方是成功后的前台处理……
				$.post(
					"{:url('member/ajax')}", {
						id: id,
						type: 'member_zhongdel',
					},
					function(result) {
						if (result === 1) {
							$(obj).parents("tr").remove();
							layer.msg('已删除!', {
								icon: 1,
								time: 1000
							});
						} else {
							layer.msg('删除失败!', {
								icon: 5,
								time: 1000
							});
						}
					});
			});
		}
	</script>
</body>
</html>
